
#include "gmatlab.h"

// void g_irepository_matlab_prepend_search_path(const gchar *dir);
void mexFunction(int nlhs, mxArray *lhs[], int nrhs, const mxArray *rhs[])
{
  gchar *dir;

  // Check and convert arguments
  if (nrhs != 1) g_matlab_error("gmatlab:numArg", "g_irepository_matlab_prepend_search_path() takes 1 argument");
  if (nlhs != 0) g_matlab_error("gmatlab:numRet", "g_irepository_matlab_prepend_search_path() has 0 return values");
  if (mxGetClassID(rhs[0]) != mxCHAR_CLASS) g_matlab_error("gmatlab:badType", "g_irepository_matlab_prepend_search_path() Arg 1 must be char, not %s", mxGetClassName(rhs[0]));
  dir = g_matlab_mxArray_get_utf8(rhs[0]);
  g_matlab_cleanup_add(g_free, dir);
  
  // Call function
  g_irepository_prepend_search_path(dir);
  
  // Prepare return value
}
